package com.tanlu.tcc.mq;

/*
@Component
@RabbitListener(queues="handler")
public class Receiver {

    private TransactionContext transactionContext;

    public void setTransactionContext(TransactionContext transactionContext) {
        this.transactionContext = transactionContext;
    }

    @RabbitHandler
    public void process(Command command) {
        System.out.println("ttc receiver:"+command);

        if(command.getTransactionStatus() == TransactionStatus.Confirm) {
            transactionContext.commit((Transaction)command.getObject());
        } else if(command.getTransactionStatus() == TransactionStatus.Cancel) {
            transactionContext.rollback((Transaction)command.getObject());
        }
    }
}*/
